package cnab.remessa.paulista;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;

public class RemessaPaulista {

	private ArrayList<RegisterDetailRemessaPaulista> registersDetail = new ArrayList<RegisterDetailRemessaPaulista>();
	private RegisterFileHeaderRemessaPaulista registerHeader = new RegisterFileHeaderRemessaPaulista();
	private RegisterFileTrailerRemessaPaulista registerTrailer = new RegisterFileTrailerRemessaPaulista();
	public static SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
	public RemessaPaulista() 
	{
				
	}
	public RemessaPaulista(RegisterFileHeaderRemessaPaulista registerHeader, ArrayList<RegisterDetailRemessaPaulista> registersDetail, RegisterFileTrailerRemessaPaulista registerTrailer) 
	{
		this.registerHeader = registerHeader;
		this.registersDetail = registersDetail;
		this.registerTrailer = registerTrailer;
	}
	public String stringRafaelFormat()
	{
		String content="";
		content= content + "Data;CodigoDoOriginador;"+RegisterDetailRemessaPaulista.labelsCSV()+"\n";
		for(RegisterDetailRemessaPaulista registerDetail:this.registersDetail)
		{
			System.out.println(registerHeader.getDataDaGravacaoDoArquivo().getValue() 
								+ ";"+ registerHeader.getCodigoDoOriginador().getValue() + ";" 
								+ registerDetail.toCSV());
			content = content + (registerHeader.getDataDaGravacaoDoArquivo().getValue() 
					+ ";"+ registerHeader.getCodigoDoOriginador().getValue() + ";" 
					+ registerDetail.toCSV()) + "\n";
			
		}
		return content;
	}
	public ArrayList<RegisterDetailRemessaPaulista> getRegistersDetail() {
		return registersDetail;
	}
	public void setRegistersDetail(
			ArrayList<RegisterDetailRemessaPaulista> registersDetail) {
		this.registersDetail = registersDetail;
	}
	public RegisterFileHeaderRemessaPaulista getRegisterHeader() {
		return registerHeader;
	}
	public void setRegisterHeader(RegisterFileHeaderRemessaPaulista registerHeader) {
		this.registerHeader = registerHeader;
	}
	public RegisterFileTrailerRemessaPaulista getRegisterTrailer() {
		return registerTrailer;
	}
	public void setRegisterTrailer(
			RegisterFileTrailerRemessaPaulista registerTrailer) {
		this.registerTrailer = registerTrailer;
	}
}
